package com.sykj.exception;

import com.sykj.util.reponse.CommonEnum;
import com.sykj.util.reponse.ResultBody;
import lombok.Data;

/**
 * @program: BeautyClub
 * @description: 自定义异常类
 * @author: qiaoli
 * @create: 2020-07-15 09:24
 */
@Data
public class BizException extends  RuntimeException {

    private static final long serialVersionUID = 1L;

    /**
     * 错误码
     */
    protected String errorCode;
    /**
     * 错误信息
     */
    protected String errorMsg;

    protected   ResultBody body;



    public BizException(){
        super();
    }


    public BizException(CommonEnum resultCode){
        this.errorMsg=resultCode.getResultMsg();
        this.errorCode=resultCode.getResultCode();
    }


    public BizException(CommonEnum resultCode, ResultBody resultBody){
        this.errorMsg=resultCode.getResultMsg();
        this.errorCode=resultCode.getResultCode();
        this.body=resultBody;
    }

}
